package me.jessyan.mvparms.demo.mvp.contract;

import android.app.Activity;

import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import com.tbruyelle.rxpermissions2.RxPermissions;

import io.reactivex.Observable;
import me.jessyan.mvparms.demo.data.entity.TopResponse;
import me.jessyan.mvparms.demo.data.entity.UploadImgEntity;
import me.jessyan.mvparms.demo.data.entity.User;
import okhttp3.MultipartBody;

/**
 * @Author: 海洋
 * @Date: 2018/8/17
 * @Desc:
 */
public interface MainContract {

    //对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
    interface View extends IView {
        Activity getActivity();
        //申请权限
        RxPermissions getRxPermissions();
    }
    //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,如是否使用缓存
    interface Model extends IModel {
        Observable<TopResponse<UploadImgEntity>> uploadImage(MultipartBody.Part imgs);
    }
}
